package Feb_15;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;

public class UpperClient {
    public static void main(String[] args) {
        try {
            //启动服务
            Socket socket = new Socket(InetAddress.getByName("127.0.0.1"),8080);
            //输入字节流给服务器
            OutputStream outputStream =socket.getOutputStream();
            outputStream.write("wow".getBytes());
            outputStream.flush();

            byte[] bytes=new byte[512];
            InputStream inputStream=socket.getInputStream();
            inputStream.read(bytes);
            String str = new String(bytes);
            System.out.println(str);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
